{% extends "base.volt" %}
{% block content %}
<div class="tpl-content-wrapper">
    <div class="tpl-content-page-title">
        系统管理
    </div>
    <ol class="am-breadcrumb">
        <li><a href="#" class="am-icon-home">首页</a></li>
        <li><a href="#">系统管理</a></li>
        <li class="am-active">管理员列表</li>
    </ol>
    <div class="tpl-portlet-components">
        <div class="portlet-title">
            <div class="caption font-green bold">
                <span class="am-icon-code"></span> 管理员列表
            </div>
            <!--<div class="tpl-portlet-input tpl-fz-ml">
                <div class="portlet-input input-small input-inline">
                    <div class="input-icon right">
                        <i class="am-icon-search"></i>
                        <input type="text" class="form-control form-control-solid" placeholder="搜索..."> </div>
                </div>
            </div>-->
        </div>
        <div class="tpl-block">
            <div class="am-g">
                <div class="am-u-sm-12 am-u-md-6">
                    <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-xs">
                            <a href="/manage/sys/opadd" class="am-btn am-btn-default am-btn-success" href=""><span class="am-icon-plus"></span> 新增</a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form">
                        <table class="am-table am-table-striped am-table-hover table-main">
                            <thead>
                            <tr>
                                <th class="table-id">ID</th>
                                <th class="table-title">登录账号</th>
                                <th class="table-type">姓名</th>
                                <th class="table-author am-hide-sm-only">角色</th>
                                <th class="table-date am-hide-sm-only">创建时间</th>
                                <th class="table-date am-hide-sm-only">状态</th>
                                <th class="table-set">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {% for v in list %}
                            <tr>
                                <td>{{ v.id }}</td>
                                <td>{{ v.username }}</td>
                                <td>{{ v.name }}</td>
                                <td class="am-hide-sm-only">{{ role_list[v.role]['name'] }}</td>
                                <td class="am-hide-sm-only">{{ v.created_at }}</td>
                                <td class="am-hide-sm-only">{{ delete(v.is_delete) }}</td>
                                <td>
                                    <div class="am-btn-toolbar">
                                        <div class="am-btn-group am-btn-group-xs">
                                            <button class="am-btn am-btn-default am-btn-xs am-text-secondary jump" data-url="/manage/sys/opedit?id={{ v.id }}"><span class="am-icon-pencil-square-o"></span> 编辑</button>
                                            {% if v.is_delete == 'N' %}
                                            <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only confirm" data-message="是否禁用?" data-url="/manage/sys/modState?state=0&id={{ v.id }}"><span class="am-icon-ban"></span> 禁用</button>
                                            {% else %}
                                            <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only confirm" data-message="是否启用?" data-url="/manage/sys/modState?state=1&id={{ v.id }}"><span class="am-icon-mail-forward"></span> 恢复</button>
                                            {% endif %}
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                        {{ tagNav.page(
                            page,
                            total,
                            limit,
                            url.get(
                                'sys/oplist',[
                                'page': '__PAGE__'
                            ]
                            ))
                        }}
                    </form>
                </div>

            </div>
        </div>
        <div style="display: none" id="post-form" callback="/manage/sys/oplist"></div>
        <div class="tpl-alert"></div>
    </div>
</div>
{% endblock %}